/*
 * This file is part of aion-engine <aion-engine.com>
 *
 * aion-engine is private software: you can redistribute it and or modify
 * it under the terms of the GNU Lesser Public License as published by
 * the Private Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * aion-engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser Public License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License
 * along with aion-engine.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.aionengine.gameserver.model.stats.container;

import com.aionengine.gameserver.model.gameobjects.Npc;
import com.aionengine.gameserver.model.stats.calc.Stat2;

/**
 * @author ATracer
 */
public class SummonedObjectGameStats extends NpcGameStats {

    public SummonedObjectGameStats(Npc owner) {
        super(owner);
    }

    @Override
    public Stat2 getStat(StatEnum statEnum, int base) {
        Stat2 stat = super.getStat(statEnum, base);
        if (owner.getMaster() == null)
            return stat;
        switch (statEnum) {
            case BOOST_MAGICAL_SKILL:
            case MAGICAL_ATTACK:
            case MAGICAL_ACCURACY:
            case MAGICAL_RESIST:
                stat.setBonusRate(0.2f);
                return owner.getMaster().getGameStats().getItemStatBoost(statEnum, stat);
            case PHYSICAL_ACCURACY:
                stat.setBonusRate(0.2f);
                owner.getMaster().getGameStats().getItemStatBoost(StatEnum.MAIN_HAND_ACCURACY, stat);
                return owner.getMaster().getGameStats().getItemStatBoost(statEnum, stat);
            case PHYSICAL_ATTACK:
                stat.setBonusRate(0.2f);
                owner.getMaster().getGameStats().getItemStatBoost(StatEnum.MAIN_HAND_POWER, stat);
                return owner.getMaster().getGameStats().getItemStatBoost(statEnum, stat);
		default:
			break;

        }
        return stat;
    }

    @Override
    public Stat2 getMAttack() {
        int power = owner.getObjectTemplate().getStatsTemplate().getPower();
        return getStat(StatEnum.MAGICAL_ATTACK, power);
    }

}
